Optimal. Leaf size=155 \[ -\frac {a b (2-m) (d \cos (e+f x))^m}{f (1-m) m}+\frac {\left (b^2-a^2 (1-m)\right ) \cos (e+f x) (d \cos (e+f x))^m \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{f (1-m) (1+m) \sqrt {\sin ^2(e+f x)}}+\frac {b (d \cos (e+f x))^m (a+b \tan (e+f x))}{f (1-m)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 155, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3596, 3589,
3567, 3857, 2722} \begin {gather*} \frac {\left (b^2-a^2 (1-m)\right ) \sin (e+f x) \cos (e+f x) (d \cos (e+f x))^m \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\cos ^2(e+f x)\right )}{f (1-m) (m+1) \sqrt {\sin ^2(e+f x)}}-\frac {a b (2-m) (d \cos (e+f x))^m}{f (1-m) m}+\frac {b (a+b \tan (e+f x)) (d \cos (e+f x))^m}{f (1-m)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2722
Rule 3567
Rule 3589
Rule 3596
Rule 3857
Rubi steps
\begin {align*} \int (d \cos (e+f x))^m (a+b \tan (e+f x))^2 \, dx &=\left ((d \cos (e+f x))^m (d \sec (e+f x))^m\right ) \int (d \sec (e+f x))^{-m} (a+b \tan (e+f x))^2 \, dx\\ &=\frac {b (d \cos (e+f x))^m (a+b \tan (e+f x))}{f (1-m)}+\frac {\left ((d \cos (e+f x))^m (d \sec (e+f x))^m\right ) \int (d \sec (e+f x))^{-m} \left (-b^2+a^2 (1-m)+a b (2-m) \tan (e+f x)\right ) \, dx}{1-m}\\ &=-\frac {a b (2-m) (d \cos (e+f x))^m}{f (1-m) m}+\frac {b (d \cos (e+f x))^m (a+b \tan (e+f x))}{f (1-m)}+\frac {\left (\left (-b^2+a^2 (1-m)\right ) (d \cos (e+f x))^m (d \sec (e+f x))^m\right ) \int (d \sec (e+f x))^{-m} \, dx}{1-m}\\ &=-\frac {a b (2-m) (d \cos (e+f x))^m}{f (1-m) m}+\frac {b (d \cos (e+f x))^m (a+b \tan (e+f x))}{f (1-m)}+\frac {\left (\left (-b^2+a^2 (1-m)\right ) \left (\frac {\cos (e+f x)}{d}\right )^{-m} (d \cos (e+f x))^m\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^m \, dx}{1-m}\\ &=-\frac {a b (2-m) (d \cos (e+f x))^m}{f (1-m) m}+\frac {\left (b^2-a^2 (1-m)\right ) \cos (e+f x) (d \cos (e+f x))^m \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{f (1-m) (1+m) \sqrt {\sin ^2(e+f x)}}+\frac {b (d \cos (e+f x))^m (a+b \tan (e+f x))}{f (1-m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 4.13, size = 330, normalized size = 2.13 \begin {gather*} \frac {\cos (e+f x) (d \cos (e+f x))^m \left (-\frac {2^{1-m} a b \left (e^{-i (e+f x)} \left (1+e^{2 i (e+f x)}\right )\right )^m \cos ^{1-m}(e+f x) \, _2F_1\left (1,\frac {m}{2};1-\frac {m}{2};-e^{2 i (e+f x)}\right )}{m}+\frac {2^{1-m} a b e^{2 i (e+f x)} \left (e^{-i (e+f x)} \left (1+e^{2 i (e+f x)}\right )\right )^m \cos ^{1-m}(e+f x) \, _2F_1\left (1,\frac {2+m}{2};2-\frac {m}{2};-e^{2 i (e+f x)}\right )}{-2+m}+\left (-\frac {b^2 \csc (e+f x) \, _2F_1\left (-\frac {1}{2},\frac {1}{2} (-1+m);\frac {1+m}{2};\cos ^2(e+f x)\right )}{-1+m}-\frac {a^2 \cos (e+f x) \cot (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right )}{1+m}\right ) \sqrt {\sin ^2(e+f x)}\right ) (a+b \tan (e+f x))^2}{f (a \cos (e+f x)+b \sin (e+f x))^2} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.38, size = 0, normalized size = 0.00 \[\int \left (d \cos \left (f x +e \right )\right )^{m} \left (a +b \tan \left (f x +e \right )\right )^{2}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (d \cos {\left (e + f x \right )}\right )^{m} \left (a + b \tan {\left (e + f x \right )}\right )^{2}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (d\,\cos \left (e+f\,x\right )\right )}^m\,{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________